package com.example.drools.spring.yc.core.agenda;

import com.example.drools.spring.yc.core.YcAgendaFilter;
import java.util.Objects;
import org.kie.api.runtime.rule.Match;

/**
 * @author ddsyw
 * @version 1.0
 * @date 2021/12/31 2:30 下午
 */
public class YcUniqueCheckFilter implements YcAgendaFilter {

    private final String ruleName;

    public YcUniqueCheckFilter(String ruleName) {
        this.ruleName = ruleName;
    }

    @Override
    public boolean accept(Match match) {
        return Objects.equals(match.getRule().getName(), this.ruleName);
    }
}
